<?php

class Application_Form_Login extends Zend_Form
{

    public function init()
    {
        $front = Zend_Controller_Front::getInstance();
        $controller = $front->getRequest()->getControllerName();
        $url = $front->getBaseUrl().'/'.$controller;
        
        $this->setName('form_'.$controller);
        
        $this->setAction($url.'/login');


        $el = new Zend_Form_Element_Text('log_login');
        $el->setLabel('Login')
                ->setRequired(true)
                ->addFilter('StripTags')
                ->addFilter('StringTrim')
                ->addValidator('NotEmpty');
        $this->addElement($el);
        
        $el = new Zend_Form_Element_Password('log_senha');
        $el->setLabel('Senha')
                ->setRequired(true)
                ->addFilter('StripTags')
                ->addFilter('StringTrim')
                ->addValidator('NotEmpty');
        $this->addElement($el);
        
        
        
        $btn = new Zend_Form_Element_Submit('submit',array('disableLoadDefaultDecorators' =>true));
        $btn->addDecorators(array(array('ViewHelper'),array('Errors')));
        $btn->setLabel('Continuar');
        $btn->setAttrib('id', 'submitbutton');
        $btn->setAttrib('class', 'btn-button');
        $this->addElement($btn);
        
    }


}

